        .section .data
input_string:   .asciz "Hello world!?!123d"

        # tohost/fromhost are data locations used by Spike
        .align 8
tohost: .byte 0
        .align 8
fromhost: .byte 0

        
        .section .text
        .globl _start
_start:
        # Load the address of the input string into a0
        la a0, input_string

        # Your code here!
        add  a1, a1, x0
_ld_add:        

        lb    a2, 0(a0)                           # fetch data from [a0+a1]
        
        beqz  a2, end_program                     # if a2 == 0 over, jump to end_program
            
        li    a4, 'a'                             # load Immediate
        bge   a2, a4, Upper_program               # if a2 > 97
        
        addi  a0, a0, 0x1
        
        j    _ld_add                             # jump to _ld_add

Upper_program:
        # addi  a3, x0, ' '
        # subi  a2, a2, a3        # a2 = a2-32
        addi  a2, a2, -32
        sb    a2, 0(a0)           # str[i] = a2;
        addi  a0, a0, 0x1
        j     _ld_add

end_program:
        # jump here when you're done
        j end_program

